package com.project.class4_8.proxyMarke.dao.impl;

import com.project.class4_8.proxyMarke.bean.SaveBean;
import com.project.class4_8.proxyMarke.dao.ISaveDao;

public class SaveDaoImpl extends BaseDao implements ISaveDao {
    /**
     * 出库商品的库存更新
     * @param productID 商品编号
     * @param number 商品数量
     */
    @Override
    public void updateNum(String productID, int number) {
        this.updateData("UPDATE t_save SET s_num =s_num+? WHERE s_productID = ? ",-number,productID);
    }

    @Override
    public void addProduct(SaveBean saveBean) {
        this.updateData("INSERT INTO t_save(s_productID,s_name,s_num)VALUES(?,?,?)",
                saveBean.getProductID(),saveBean.getName(),saveBean.getNumber());
    }
}
